
<section>
<?php echo form_open_multipart('admincp/adduser'); ?>
	<fieldset>
		<label>Thêm mới quản trị</label>
		<section>
			<table>
			<thead>
				<tr> 
					<th>Ảnh đại diện</th>
					<th>Tên sản phẩm</th>
					<th>Thể loại</th>
					<th>Kích hoạt</th>
					<th>Các quyền</th> 
					<th></th>
				</tr>
			</thead>
			<tbody>
				<?php foreach($ulists as $row):?>
				<tr> 	
					<td><img src="<?php echo $this->config->item('base_url')?>uploads/avatars/<?php print $row->avatar; ?>" width="50px" height="50px"></td>
					<td><?php print $row->uname ?></td>
					<td><?php if($row->utype == 1):?>
						Admin
						<?php elseif($row->utype == 2):?>
						Quản lý chuyên mục
						<?php else:?>
						Thành viên
					<?php endif;?>
					</td>
					<td><?php print $row->uactive ?></td>
					<td><?php print $row->ukey ?></td>
					<td><a href="<?php  echo site_url('admincp/deleteuser');?>/<?php print $row->uid ; ?>">Xóa</a></td> 
				</tr>
				<?php endforeach; ?> 
			</tbody>
			</table>
		</section>
		<section>
			<label for="text_field">Tên đăng nhập</label>
			<div><input type="text" class="textinput" id="username" name="username"></div>
		</section>
		<section>
			<label for="text_field">Mật khẩu & Nhập lại mật khẩu</label>
			<div><input type="password" class="textinput" id="password" name="password"></div>
		</section>
 
		<section>
			<label for="file_upload">Avatar<br>
				<span>File yêu cầu phải là định dạng ảnh</span>
			</label>
			<div><input type="file" id="password" name="userimage"></div>
		</section>
		<section>
			<label for="dropdown_vegetables">Loại user</label>
			<div>					
				<select name="utype" id="utype"> 
						<option value="1">Admin</option>
						<option value="2">Quản lý chuyên mục</option>
						<option value="3" selected="selected">Người dùng bình thường</option> 
				</select>
			</div>
		</section>
		<section>
			<label for="multiselect">Các quyền<br>
			<span>Giữ nút SHIFT để chọn được nhiều quyền</span></label>
			<div>					
				<select name="multiple" id="multiple" multiple>
				<?php foreach($modules as $row):?>
					<option value="<?php echo $row->fid; ?>">
						 <?php echo $row->fname; ?> 
					</option> 
				<?php endforeach; ?> 
				</select>
				<script>
				    function displayVals() {
				      var singleValues = $("#single").val();
				      var multipleValues = $("#multiple").val() || [];
				      $("#checkedrules").val(multipleValues.join(", "));
				      $('#rules').val(multipleValues.join(", "));
				    } 
				    $("select").change(displayVals); 
				    displayVals(); 
				</script> 
			 <input type="hidden" value="" name="rules" id="rules">
			 <input type="hidden" value="" name="checkedrules" id="checkedrules">
			</div>
		</section>
		<section>
			<label>Kích hoạt</label>
			<div>
				<input type="radio" id="radio" name="radio" value="1" ><label for="radio">Kích hoạt</label>
				<input type="radio" id="radio" name="radio" value="0" ><label for="radio">Kích hoạt sau</label>
			</div>
		</section>
		<section>
			<?php echo form_submit('submit',"Thêm mới",array('onlick'=>'javascript:show();'));  ?>
		</section> 	
			
	</fieldset>
<?php echo form_close();?>
</section>
